#include <bits/stdc++.h>

using namespace std;

int n;
int r[100005];
int cnt[100005];
bool vis[100005];
int res[100005];

int main(){
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	freopen ("duel.in", "r", stdin);
	freopen ("duel.out", "w", stdout);
	cin >> n;
	int a = 1;
	for (int i = 1; i <= n; i++){
		cin >> r[i];
		cnt[r[i]]++;
		if (!vis[r[i]]){
			res[a] = r[i];
			vis[r[i]] = true;
			a++;
		}
	}
	sort (res + 1, r + a + 1);
	long long ans = 0;
	for (int i = 1; i <= a; i++){
		ans = ans + min (cnt[res[i]], cnt[res[i + 1]]);
	}
	cout << n - ans << '\n';
	return 0;
}
